/**
 * Copyright (c) 2011-2014, James Zhan 詹波 (jfinal@126.com).
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 */

package net.dreamlu.controller.api;

import com.jfinal.weixin.sdk.api.ApiConfig;
import com.jfinal.weixin.sdk.jfinal.MsgControllerAdapter;
import com.jfinal.weixin.sdk.msg.in.InTextMsg;
import com.jfinal.weixin.sdk.msg.in.event.InFollowEvent;
import com.jfinal.weixin.sdk.msg.in.event.InMenuEvent;
import com.jfinal.weixin.sdk.msg.out.OutTextMsg;

/**
 * 微信消息接口
 */
public class WeixinMsgController extends MsgControllerAdapter {
	@Override
	protected void processInFollowEvent(InFollowEvent inFollowEvent) {
		OutTextMsg outMsg = new OutTextMsg(inFollowEvent);
		outMsg.setContent("《如梦技术》感谢您的关注");
		render(outMsg);
	}

	@Override
	protected void processInTextMsg(InTextMsg inTextMsg) {
		OutTextMsg outMsg = new OutTextMsg(inTextMsg);
		outMsg.setContent("《如梦技术》感谢您的关注");
		render(outMsg);
	}

	@Override
	protected void processInMenuEvent(InMenuEvent inMenuEvent) {
		OutTextMsg outMsg = new OutTextMsg(inMenuEvent);
		outMsg.setContent("《如梦技术》感谢您的关注");
		render(outMsg);
	}

	public static ApiConfig apiConfig;

	@Override
	public ApiConfig getApiConfig() {
		if (null != apiConfig) {
			return apiConfig;
		}
		return null;
	}
}






